<?php

namespace App\Http\Requests;

use App\Http\Requests\Request;

class GroupCreateRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title' => 'required|max:255',
            'directory' => 'required|max:255',
        ];
    }

    /**
     * 获取已定义验证规则的错误消息。
     *
     * @return array
     */
    public function messages()
    {
        return [
            'title.required' => '【分组名】不能为空！请您填写再进行提交！（~^_^~)',
            'directory.required'  => '【分组目录】不能为空！请您填写再进行提交！（~^_^~)',
        ];
    }
}
